package com.poorstu.web.auditaction;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.common.base.web.BaseAction;
import com.poorstu.manager.BursaryManager;
import com.poorstu.manager.LoginMeg;
import com.poorstu.manager.PoorStudentManager;
import com.poorstu.model.BursaryMod;
import com.poorstu.model.LoginMod;
import com.poorstu.model.StuPoorMod;

public class AuditBursaryMagAction extends BaseAction {
	

	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		
		try{
			int allUserId =(Integer)request.getSession().getAttribute("allUserId");
			BursaryManager bursaryManager=(BursaryManager)getBean("bursaryManager");
			
			LoginMeg loginMeg = (LoginMeg)getBean("loginMeg");
			LoginMod login=loginMeg.selectUserById(allUserId);
			
			int roleId =login.getRoleId().getRoleId();
			
			List<BursaryMod> bursaryList=bursaryManager.AuditBursary(roleId, allUserId);
		
			request.setAttribute("bursaryList", bursaryList);
		
		return mapping.findForward("succ");
		}
		catch(Exception e){
			e.printStackTrace();
			return mapping.findForward("failure");
		}
	}
	

}
